[MUSIC] AI is transforming the way
that we write code, and there's no clearer evidence
of this than GitHub Copilot. Trained on vast amounts of code from
various programming languages and repositories, GitHub Copilot serves
as your virtual coding partner, providing valuable suggestions
to expedite the coding process. In this demo video, we will demo
GitHub Copilot to showcase its ability to recognize coding patterns and
significantly reduce development and debugging time. It's not free though,
starting at $10 per month. You can try it out with a free trial,
but you'll need to sign up for a GitHub account and
provide payment details. It's essential to cancel before the 30 day
trial period ends to avoid being charged. You can go to GitHub Copilot's site and
start your 30 day trial. Copilot itself does not have a GUI. To get started, you'll need to install
the extension for your code editor and sign in using your GitHub account. In this demo, we will use VS Code. Once you open the VS Code, you can head
over to Extensions and then search for Copilot. Make sure to install the Copilot
extension and not the other related ones. Once installed, Copilot would prompt you
to authenticate yourself using GitHub. In Versus Code, you can press Ctrl+I to
bring up the Copilot prompt at any time. Let's generate some functions and code. Let's say we want to write a function
to find the min and max of an array. All we need to do is write the prompt and the code will be automatically
generated for you. You can also accept or
discard the suggestions. Next, let's say we are tasked with
writing an API to code the weather API. Once we write the prompt, the code
is generated automatically for us. Most of the time, you will observe that
the general boilerplate template is generated first before it can be refined. You can accept or
discard the suggestions as usual. If you want the explanation
on how this code is written, you can use the forward
slash explain prompt. You can bring the Copilot prompt and
select /explain, which would explain how each piece of the
code is written in a documentation manner. Now let's use some useful utilities, assume you are creating
a constant of all time zones, it's not easy to remember all the time
zones, but Copilot is of great help here. You can start with a comment on
what you expect in the code. When you initialize the variable,
the Copilot starts suggesting all of the required time zones based
on initial prompts, for example, when you start GMT or America,
the Copilot will fill in the rest and you can press the tab to
accept the suggestion. Now let's use Copilot for
some heavy lifting, let's generate an HTML template to
help a front-end engineer get started. The prompt can be as simple
as generate HTML template and a boilerplate template
will be generated for you. You can accept the suggestions. If you need to add beautification, you can
prompt Copilot to add bootstrap to it. You see that a local path to
the bootstrap has been generated. Copilot also shows you what
has been added in the code. You can go further and
prompt Copilot to add the online CDN path, which will be done
automatically in the code. Copilot can also be used to debug and
troubleshoot code, for example, given this JavaScript code, you can see
that the bug in this code is that the loop in the calculate average function
starts at index 1 instead of index 0. We can ask Copilot to find
the bugs in this code, provide suggestions to fix the code,
and accept the suggestion. Copilot shows you the comparison
between the before and after code for you to evaluate. You can see how GitHub Copilot enhances
your coding speed, code quality, and helps in troubleshooting
the software development process. [MUSIC]